import {
    updateNodeElement
} from "./"

export function createDOMElement(virtualDOM) {
    let newEl
    if (virtualDOM.type === 'text') {
        newEl = document.createTextNode(virtualDOM.props.textContent)
    } else {
        newEl = document.createElement(virtualDOM.type)
        updateNodeElement(newEl, virtualDOM)
    }
    return newEl
}